import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:xin_he/page/mine/xin_he_mine_work_space/xin_he_map_util.dart';

import '../../../utils/xh_styles.dart';
import '../../../utils/xin_he_image.dart';
import 'xin_he_mine_work_space_logic.dart';

class XinHeMineWorkSpacePage extends StatelessWidget {
  XinHeMineWorkSpacePage({Key? key}) : super(key: key);

  final logic = Get.put(XinHeMineWorkSpaceLogic());
  final state = Get.find<XinHeMineWorkSpaceLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Obx(() => Scaffold(
      appBar: AppBar(
        leading: IconButton(
            onPressed: (){
              Get.back();
            },
            icon: Container(
              padding: const EdgeInsets.only(left: 7),
              alignment: Alignment.centerLeft,
              child: const XinHeAssetImage(
                'assets/images/home/app_back_3.png',
                width: 9.5,
                height: 17,
                fit: BoxFit.cover,),
            )
        ),
        backgroundColor: Colors.white,
        shadowColor: Colors.transparent,
        title: Text('工作室',style: TextStyle(color:XinHeColor('#222222'),fontSize: 17,fontWeight: FontWeight.w600)),
        centerTitle: true,
      ),
      body: Column(children: [
        const SizedBox(height: 10,),
        Container(
          width: Get.width-30,
          margin: const EdgeInsets.symmetric(horizontal: 15),
          decoration: BoxDecoration(color: Colors.white,borderRadius: BorderRadius.circular(5)),
          height: 89.5,
          child: Column(children: [
            Container(
              height: 44.5,
              padding: const EdgeInsets.symmetric(horizontal: 15),
              child: Row(children: [
                Text('编号',style: TextStyle(color: XinHeColor('#738181'),fontSize: 14,fontWeight: FontWeight.w500),),
                Spacer(),
                Text(logic.model.value.codeName??'',style: TextStyle(color: XinHeColor('#333333'),fontSize: 14,fontWeight: FontWeight.w500),),

              ],),
            ),
            Container(
              margin: const EdgeInsets.symmetric(horizontal: 15),
              height: 0.5,width: Get.width-60,color: XinHeStyle.lineColor,),
            Container(
              height: 44.5,
              padding: const EdgeInsets.symmetric(horizontal: 15),
              child: Row(children: [
                Text('具体地址',style: TextStyle(color: XinHeColor('#738181'),fontSize: 14,fontWeight: FontWeight.w500),),
                Spacer(),
                GestureDetector(
                  onTap: (){
                    XinHeMapUtil.gotoAMap(logic.model.value.longitude, logic.model.value.latitude);
                  },
                  child: Row(children: [
                    Text('去这里',style: TextStyle(color: XinHeColor('#333333'),fontSize: 14,fontWeight: FontWeight.w500),),
                    const SizedBox(width: 5,),
                    const XinHeAssetImage('assets/images/mine/go_there.png',width: 21,height: 21,)
                  ],),
                )

              ],),
            ),

          ],),
        )

      ],),

    ));
  }
}
